Skip to content

WIP: Implement orchestrion-based instrumentation for vercel-ai v6#21658

Draft
mydea wants to merge 3 commits into
developfrom
fn/try-orchestrion
Draft

WIP: Implement orchestrion-based instrumentation for vercel-ai v6#21658
mydea wants to merge 3 commits into
developfrom
fn/try-orchestrion

Conversation

@mydea

@mydea mydea commented Jun 19, 2026

Copy link
Copy Markdown
Member

WIP...

This is on top of #21613

When using orchestrion, this replaces the regular vercelAiIntegration with the channel-variant. This today supports vercel ai v6 and v7 (v5/v4 support TBD).

Test coverage exists and everything passes. This does not add any event processors etc. anymore, everything works inside of the integrations.

OTEL Spans emitted directly by vercel-ai v6 or below are ignored to avoid double instrumentation.

@mydea mydea self-assigned this Jun 19, 2026
Comment thread packages/server-utils/src/vercel-ai/vercel-ai-orchestrion-v6-subscriber.ts Outdated
Comment thread packages/server-utils/src/vercel-ai/vercel-ai-orchestrion-v6-subscriber.ts Outdated
Comment thread dev-packages/node-integration-tests/suites/tracing/vercelai/v6_v7/test.ts Outdated
@mydea mydea force-pushed the fn/vercel-ai-v7 branch 9 times, most recently from 9145703 to abad3a9 Compare June 25, 2026 11:33
Base automatically changed from fn/vercel-ai-v7 to develop June 25, 2026 13:20
@mydea mydea force-pushed the fn/try-orchestrion branch from 3417464 to d05d40e Compare June 26, 2026 11:13

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d05d40e. Configure here.

asyncLocalStorage: lookup.asyncLocalStorage,
getStoreWithActiveSpan: (span: Span) => api.trace.setSpan(api.context.active(), span as api.Span),
asyncLocalStorage,
getStoreWithActiveSpan: span => api.trace.setSpan(api.context.active(), span as api.Span),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty binding skips retry

Medium Severity

With skipOpenTelemetrySetup, getTracingChannelBinding can return a binding whose asyncLocalStorage is still undefined when the global OpenTelemetry context manager is not registered yet. waitForTracingChannelBinding treats any truthy binding as ready, so it runs channel subscribers immediately during Sentry.init() instead of retrying after the user registers their context manager.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d05d40e. Configure here.

// If it still fails, we bail and do nothing
setTimeout(() => {
waitForTracingChannelBinding(callback, retries - 1);
}, 1);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Timer missing safeUnref call

Low Severity

waitForTracingChannelBinding schedules a setTimeout retry in @sentry/core without calling safeUnref (or unref), which can keep short-lived Node processes alive until the timer fires.

Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Reviewed by Cursor Bugbot for commit d05d40e. Configure here.

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 27.47 kB - -
@sentry/browser - with treeshaking flags 25.91 kB - -
@sentry/browser (incl. Tracing) 45.97 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 47.72 kB - -
@sentry/browser (incl. Tracing, Profiling) 50.76 kB - -
@sentry/browser (incl. Tracing, Replay) 85.22 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 74.81 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 89.91 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 102.57 kB - -
@sentry/browser (incl. Feedback) 44.66 kB - -
@sentry/browser (incl. sendFeedback) 32.26 kB - -
@sentry/browser (incl. FeedbackAsync) 37.4 kB - -
@sentry/browser (incl. Metrics) 28.54 kB - -
@sentry/browser (incl. Logs) 28.78 kB - -
@sentry/browser (incl. Metrics & Logs) 29.47 kB - -
@sentry/react 29.27 kB - -
@sentry/react (incl. Tracing) 48.28 kB - -
@sentry/vue 32.63 kB - -
@sentry/vue (incl. Tracing) 47.84 kB - -
@sentry/svelte 27.5 kB - -
CDN Bundle 29.89 kB - -
CDN Bundle (incl. Tracing) 47.89 kB - -
CDN Bundle (incl. Logs, Metrics) 31.44 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 49.24 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 70.78 kB - -
CDN Bundle (incl. Tracing, Replay) 85.4 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86.68 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 91.19 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.45 kB - -
CDN Bundle - uncompressed 88.94 kB - -
CDN Bundle (incl. Tracing) - uncompressed 145.03 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 93.65 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 149 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 218.62 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 264.05 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 268 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 277.75 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 281.69 kB - -
@sentry/nextjs (client) 50.67 kB - -
@sentry/sveltekit (client) 46.37 kB - -
@sentry/core/server 77.58 kB +0.06% +39 B 🔺
@sentry/core/browser 63.92 kB +0.06% +37 B 🔺
@sentry/node-core 61.54 kB +0.06% +34 B 🔺
@sentry/node 123.56 kB +0.07% +76 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 69.95 kB - -
@sentry/node/light 50.4 kB - -
@sentry/node - without tracing 73.63 kB +0.03% +20 B 🔺
@sentry/aws-serverless 84.44 kB +0.05% +41 B 🔺
@sentry/cloudflare (withSentry) - minified 180.31 kB - -
@sentry/cloudflare (withSentry) 446.24 kB - -

View base workflow run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant